﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Htse.Blue.Models;

namespace Htse.Blue.Data
{
	public class CityRepository : LinqToSqlRepositoryBase<City, int, BlueEntityModelDataContext>, ICityRepository
	{
		public override City GetById(int id)
		{
			return dataContext.Cities.SingleOrDefault(c => c.Id == id);
		}

		#region ICityRepository Members

		public City GetByName(string name)
		{
			return dataContext.Cities.SingleOrDefault(c => c.Name == name);
		}

		#endregion
	}
}
